#include <iostream>

using namespace std;

class Operation
{
public:
    virtual double get_result(double a, double b) = 0;
};

class Add : public Operation
{
public:
    double get_result(double a, double b) override
    {
        return a + b;
    }
};

class AddV2 : public Operation
{
public:
    double get_result(double a, double b) override
    {
        cout << "add:";
        return a + b;
    }
};

class Sub : public Operation
{
public:
    double get_result(double a, double b) override
    {
        return a - b;
    }
};


class Cal
{
public:
    Cal(Operation &add, Operation &sub) : m_add(add), m_sub(sub)
    {

    }
    double add(double a, double b)
    {
        return m_add.get_result(a,b);
    }

    double sub(double a, double b)
    {
        return m_sub.get_result(a,b);
    }
    
    Operation &m_add;
    Operation &m_sub;
};


int main(int argc, char **argv)
{
    string op;
    double a;
    double b;

    cin >> a;
    cin >> b;
    cin >> op;

    AddV2 add;
    Sub sub;
    Cal cal(add, sub);

    cout << cal.add(a, b) << endl;
    cout << cal.sub(a, b) << endl;
    
    return 0;
}